<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../../../print.css" type="text/css" media="print">
<meta content="IModelLocator,com.adobe.cairngorm.model.IModelLocator" name="keywords">
<title>com.adobe.cairngorm.model.IModelLocator</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'IModelLocator - Adobe Consulting EMEA - Cairngorm';
				var baseRef = '../../../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">API Documentation</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../../../all-classes.html')" href="../../../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../../all-classes.html')" href="../../../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../../index-list.html')" href="../../../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../../../index.html?com/adobe/cairngorm/model/IModelLocator.html&amp;com/adobe/cairngorm/model/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Interface&nbsp;IModelLocator</td><td align="right" id="subNav" class="titleTableSubNav"></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Interface IModelLocator"); titleBar_setSubNav(false,false,false,false,false,false,false,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">com.adobe.cairngorm.model</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Interface</td><td class="classSignature">public interface IModelLocator</td>
</tr>
<tr>
<td class="classHeaderTableLabel">Subinterfaces</td><td><a href="../model/ModelLocator.html">ModelLocator</a></td>
</tr>
</table>
<p></p>
    Marker interface used to mark the custom ModelLocator.
    
    <p>IModelLocator is the marker interface used by Cairngorm applications
    to implement the model in an Model-View-Controller architecture.</p>
    <p>The model locator in an application is a singleton that the application
    uses to store the client side model. An example implementation might be:</p>
    <pre>
    [Bindable]
    public class ShopModelLocator implements IModelLocator
    {
       private static var instance : ShopModelLocator;
    
       public function ShopModelLocator() 
       {   
          if ( instance != null )
          {
             throw new CairngormError(
                CairngormMessageCodes.SINGLETON_EXCEPTION, "ShopModelLocator" );
          }
           
          instance = this;
       }
       
       public static function getInstance() : ShopModelLocator 
       {
          if ( instance == null )
              instance = new ShopModelLocator();
              
          return instance;
       }
     
       public var products : ICollectionView;
    }
    </pre>
    
    <p>Throughout the rest of the application, the developer can then access
    the products from the model, as follows:</p>
    <pre>
      var products : ICollectionView = ShopModelLocator.getInstance().products;
    </pre>
    <p></p>
<br>
<hr>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright"> 
</center>
</div>
</body>
</html>
<!-- -->
